<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>动态显示时间</title>
		<script>
			function getRealTime() 
			{
				var a = new Date();
				var array = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
				var time = array[a.getDay()] + "，" + a.getFullYear() + "年" + (a.getMonth() + 1) + "月" + a.getDate() + "日，" + a.getHours() + "小时" + a.getMinutes() + "分钟" + a.getSeconds() + "秒";
				document.getElementById("b").innerHTML=time;
			}
			setInterval("getRealTime()", 1000);
		</script>
	</head>
		<body>
		<div id="b" style="text-align: left;"></div>
	</body>
</html>
